package avicit.bdp.dcs.utils;

import avicit.bdp.common.utils.ConfigUtils;
import avicit.bdp.core.constant.Constants;

/**
 * @金航数码科技有限责任公司
 * @作者：liyb
 * @邮箱：liyb@avic-digital.com
 * @创建时间： 2020-08-05 16:33
 * @类说明：
 * @修改记录：
 */
public final class DcsConstants {

    public static final String MYSQL_DATABASE = "Unknown database";
    public static final String MYSQL_CONNEXP = "Communications link failure";
    public static final String MYSQL_ACCDENIED = "Access denied";
    public static final String MYSQL_TABLE_NAME_ERR1 = "Table";
    public static final String MYSQL_TABLE_NAME_ERR2 = "doesn't exist";
    public static final String MYSQL_SELECT_PRI = "SELECT command denied to user";
    public static final String MYSQL_COLUMN1 = "Unknown column";
    public static final String MYSQL_COLUMN2 = "field list";
    public static final String MYSQL_WHERE = "where clause";

    public static final String ORACLE_DATABASE = "ORA-12505";
    public static final String ORACLE_CONNEXP = "The Network Adapter could not establish the connection";
    public static final String ORACLE_ACCDENIED = "ORA-01017";
    public static final String ORACLE_TABLE_NAME = "table or view does not exist";
    public static final String ORACLE_SELECT_PRI = "insufficient privileges";
    public static final String ORACLE_SQL = "invalid identifier";

    public static final String JOB_TYPE = "jobType";
    public static final String DATA_END_TIME = "DATA_END_TIME";

    public static final String HIVE_TABLE_LOCATION = ConfigUtils.getInstance().getString(Constants.HIVE_TABLE_LOCATION);

    public static final String CREATE_TABLE_SQL = "createTableSql";
    public static final String PARAMS = "params";
    public static final String JSON = "json";
    public static final String JOB = "job";
    public static final String CONTENT = "content";
    public static final String READER = "reader";
    public static final String PARAMETER = "parameter";
    public static final String DEFAULT_FS = "defaultFS";
    public static final String LOCAL_PARAMETERS_MAP = "localParametersMap";
    public static final String VALUE = "value";

    public static final String LAST_UPDATE_DATE = "last_update_date";
    public static final String NAME = "name";
    public static final String DESC = "desc";
    public static final String ASC = "asc";
    public static final String PATTERN = ",###,##0";
    public static final String SPOT = "\\.";
    public static final String STOP = "STOP";

    /**
     * 消息模板文件中，前10列是设备信息（设备编号、设备名称、设备类型ID、设备类型名称、区域ID、区域名称、资产编号、资产名称、用户ID、用户名称），
     * 后面1列是参数信息（参数名称、参数说明）
     */
    public static final int TEMPLATE_FILE_DEVICE_BASE_INFO_CELL_INDEX = 9;

    /**
     * 消息模板文件中，前10列是设备信息（设备编号、设备名称、设备类型ID、设备类型名称、区域ID、区域名称、资产编号、资产名称、用户ID、用户名称），
     * 后面1列是参数信息（参数名称、参数说明）
     */
    public static final int TEMPLATE_FILE_META_CELL_INDEX = 10;

    /**
     * 分页查询消息模板时，排序标准;1:按修改时间倒序、2:按修改时间升序、3:按模板名称升序、4:按模板名称倒序
     */
    public static final int ORDERED_BY_MODIFIED_TIME_DESC = 1;
    public static final int ORDERED_BY_MODIFIED_TIME_ASC = 2;
    public static final int ORDERED_BY_TEMPLATE_NAME_ASC = 3;
    public static final int ORDERED_BY_TEMPLATE_NAME_DESC = 4;
    public static final String ORDERED_BY_TEMPLATE_NAME = "device_name";

    /**
     * 消息模板示例文件存放位置
     */
    public static final String MSG_TEMPLATE_EXAMPLE_FILE_PATH = "example.xlsx";
    public static final int MSG_TEMPLATE_EXAMPLE_FILE_WRITER_BUFFER_SIZE = 1024;

    /**
     * 分页查询脱敏策略时，排序标准;1:按修改时间倒序、2:按修改时间升序、3:按桶/对象名称升序、4:按桶/对象名称倒序
     */
    public static final int ORDERED_BY_POLICY_NAME_ASC = 3;
    public static final int ORDERED_BY_POLICY_NAME_DESC = 4;
    public static final String ORDERED_BY_LAST_UPDATE_TIME = "last_update_date";
    public static final String ORDERED_BY_POLICY_NAME = "name";
    public static final String ORDERED_ASC = "asc";
    public static final String ORDERED_DESC = "desc";

    public static final String SPARK = "SPARK";
    public static final String ENDPOINT = "endpoint";

}
